import Http from "@/http"

export function pageApi(params:any) {
    return Http.get('device/page', params)
}

export function saveApi(params:any) {
    return params.id ? Http.put('device/edit/' + params.id, params) : Http.post('device/add', params)
}

export function importDevice(params:any[]) {
    return Http.post('device/import', params)
}

export function listApi(deviceIds?:number[]) {
    let params:any = {

    }

    if(deviceIds && deviceIds.length > 0) {
        params.deviceIds = deviceIds.join(',')
    }

    return Http.get('device/list', params)
}

export function deleteApi(id) {
    return Http.delete('device/delete/' + id)
}